<?php

/**
 * fin actions.
 *
 * @package    tinystockmis
 * @subpackage fin
 * @author     Linfeng Wu
 * @version    SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class finActions extends sfActions {
    /**
     * Executes index action
     *
     * @param sfRequest $request A request object
     */
    public function executeIndex(sfWebRequest $request) {
        //$request->setRequestFormat("xml");
        //echo "abc";
        //$this->value = array('title'=>'这是标题', 'content'=>array('这是内容','this is content2'));

        //return sfView::NONE;
        $this->forward('default', 'module');
    }

    public function executeGetVoucherSummaries(sfWebRequest $request) {
        $this->summaries = Doctrine::getTable("AcctBriefSummary")->getAllBriefSummaryTitle();

    }

    public function executeGetAccountSubjectesOption(sfWebRequest $request) {
        //从AcctSet表中取属于当前账套的会计科目
        $subjectes = Doctrine::getTable("AcctSubject")->getAcctSubjectes($request->getParameter('acct_set_id'));
        //$this->subjectes = Doctrine::getTable("AcctSubject")->getAcctSubjectesAssoc($request->getParameter('acct_id'));
        $subjectes_arr = Doctrine::getTable("AcctSubject")->getAcctSubjectesAssoc($subjectes);
        $subject_tree = Doctrine::getTable("AcctSubject")->getAcctSubjectesTree($subjectes);

        $this->options = Doctrine::getTable("AcctSubject")->generateAcctSubjectOptions($subject_tree, $subjectes_arr);
        //return sfView::NONE;
        //echo $this->options;
        /*if($request->getRequestFormat() == 'json') {
          $this->subject_tree_json = json_encode($this->subject_tree);
      }*/
    }


}
